package kr.hkit.powerjava.chapter07;

import java.util.Scanner;

public class WorkFor03 {
	public static void main(String[] args) {
		int sum=0;
		int size;
		System.out.print("정수를 입력하세요 : ");
		Scanner sc = new Scanner(System.in);
		size = sc.nextInt();
		int[] n =  new int[size];
		
		for(int i=0; i<= n.length-1; i++){
			System.out.print("(0이 입력되면 멈춤) : ");
			sum += n[i];
			if(n[i]==0){
				break;
			}
		}
		
		System.out.println(sum);
		
		
	}
}
